<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Reads bytes from a file descriptor</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.dio-open.html">« dio_open</a></li>
      <li style="float: right;"><a href="function.dio-seek.html">dio_seek »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.dio.html">Direct IO 函数</a></li>
    <li>Reads bytes from a file descriptor</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.dio-read" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">dio_read</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5 &lt; 5.1.0)</p><p class="refpurpose"><span class="refname">dio_read</span> &mdash; <span class="dc-title">Reads bytes from a file descriptor</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.dio-read-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>dio_read</strong></span>(<span class="methodparam"><span class="type">resource</span> <code class="parameter">$fd</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$len</code><span class="initializer"> = 1024</span></span>): <span class="type">string</span></div>

  <p class="para rdfs-comment">
   The function <span class="function"><strong>dio_read()</strong></span> reads and returns
   <code class="parameter">len</code> bytes from file with descriptor
   <code class="parameter">fd</code>. 
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.dio-read-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">fd</code></dt>

     <dd>

      <p class="para">
       The file descriptor returned by <span class="function"><a href="function.dio-open.html" class="function">dio_open()</a></span>.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">len</code></dt>

     <dd>

      <p class="para">
       The number of bytes to read. If not specified,
       <span class="function"><strong>dio_read()</strong></span> reads 1K sized block.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.dio-read-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   The bytes read from <code class="parameter">fd</code>.
  </p>
 </div>

 <div class="refsect1 seealso" id="refsect1-function.dio-read-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.dio-write.html" class="function" rel="rdfs-seeAlso">dio_write()</a> - Writes data to fd with optional truncation at length</span></li>
   </ul>
  </p>
 </div>

</div></div></div></body></html>